const http = require('http')
process.on('message',(msg,server)=>{
  if(msg==='server'){
    console.log('子进程已创建');
    const lserver=http.createServer()
    lserver.on('request',(rq,rs)=>{
      if(rq!='favoicon.ico'){
        let sum=0;
        for(let i=0;i<1000000;i++){
          sum+=i;
        }
        rs.write('客户端的请求在子进程中被处理')
        rs.end('sum='+sum)
      }
    })
    lserver.listen(server)
  }
})